import javax.swing.*;

import java.awt.*;
import java.awt.event.*;


public class MailInfoWindow extends JDialog {
	
	static MailInfoWindow frame;

	private MailInfoWindow(JFrame frame, String str) {
		super(frame,str);
		addWindowListener(new WindowAdapter(){
			public void windowClosing(WindowEvent evt){

			}

		});
	}

	public static void Create(){

		frame = new MailInfoWindow(new JFrame(), "New Mail");
		Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
		JPanel panel = new JPanel();
		panel.setSize(200,200);
		JLabel lbl = new JLabel("You got " + Gmail.NumberOfEmails + " new email!");
		panel.add(lbl);
		frame.add(panel);
		frame.setSize(150, 60);
		frame.setLocation(dim.width-148,dim.height-125);
		frame.setVisible(true);
		try {
			Thread.sleep(3000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		frame.setVisible(false);

	}

	public static void Hide(){
		frame.setVisible(false);
	}
	public static void Show(){
		frame.setVisible(true);
		try {
			Thread.sleep(3000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		frame.setVisible(false);
	}








}




